 subroutine calciabci_n5(r1, r2, t1, t2, fae, wmbej, & 
               icore)
 !use common
 use mod_iop
 use mod_size
 use mod_orbit
 use mod_ioff 
 use mod_symm
 implicit none
 real*4, intent(in) :: r1(*), r2(*), t1(*), t2(*)
 real*4, intent(in) :: fae(*), wmbej(*), icore(*)
 !
 real*8 tt(20), rt(20)
 integer irrepci, irrepab, numci, numabc, iofft2(8)
 integer irrepi, irrepc, numc, numi, nabsym(8), nabsym2(8)
 integer nsize, irrepj, irrepabi, numj, numabi
 integer irrepabc, irrepabj, iofft2sym, i, ioffi2(8)
 integer ioffi22, iofft22, numabj
 integer ioffw2(8), ioffw22, numabj2
 integer ioffw3(8), ioffw33
 integer i0, i1, i2, i3, i4, i5
 character*8 fnameaa, fnameab, fnameba, fnamebb
 !
 real*4, allocatable :: itmp(:), r1tmp(:)
 real*4, allocatable :: ttest(:) 
 integer, external :: irpdso, isymoffso, idsymsoc
 real*8, external :: nrm2so
 if(prec==8) then 
    fnameaa = 'ABCIAA__'
    fnameab = 'ABCIAB__'
    fnameba = 'ABCIBA__'
    fnamebb = 'ABCIBB__'
 elseif(prec==4) then 
    fnameaa = 'ABCIAAS_'
    fnameab = 'ABCIABS_'
    fnameba = 'ABCIBAS_'
    fnamebb = 'ABCIBBS_'
 endif
 i0 = 1               !t2tmp
 i1 = i0 + nvvoo*isd  !r2tmp
 i2 = i1 + nvvoo*isd  !itmp
 i3 = i2 + nvvv*isd   !twmbej1
 i4 = i3 + nvvoo*isd  !twmbej2 
 i5 = i4 + nvvoo*isd 
 allocate(r1tmp(nifvv*isd), itmp(nifvv*isd))
 !---------------------------------------------------------
 !AAAA
 call izero(nabsym, 8)
 do irrepab = 1, nirrep 
    nabsym(irrepab) = irpdso(irrepab, vrta, vrta, 0) 
    nabsym2(irrepab) = irpdso(irrepab, vrta, vrta, 1) 
 enddo
 call iexpso(t2(ioi3(1)), icore(i5), vrta, vrta, 0, 0, popa, popa, 0, 1, 1)
 call sstgenso(icore(i5), icore(i0), nsize, nabsym, zorb, popa, popa, &
               icore, 1, '1324')
 nsize = idsymsoc(1, vrta, vrta, 0, popa, popa, 1) 
! write(6,*)'norm of t2', nsize, nrm2so(nsize, t2tmp, 1)
!
 iofft2(1) = 1
 ioffi2(1) = 1
 ioffw2(1) = 1
 do irrepj = 1, nirrep-1
    irrepabi = dirprd(irrepj, 1)
    numj = popa(irrepj) 
    numabi = irpdso(irrepabi, nabsym, popa, 1) 
    numabc = irpdso(irrepabi, nabsym, vrta, 1)
    iofft2(irrepj+1) = iofft2(irrepj) + numj*numabi*isd
    ioffi2(irrepj+1) = ioffi2(irrepj) + numj*numabc*isd
    numabi = irpdso(irrepabi, nabsym2, popa, 1) 
    ioffw2(irrepj+1) = ioffw2(irrepj) + numj*numabi*isd
 enddo
 nsize = irpdso(1, vrta, popa, 1)
 call zeroso(r1tmp, nsize)
 call myicopyso(r1, r1tmp, nsize)
 ! write(6,*)'norm of r1aa, iabci', nsize, nrm2so(nsize, r1tmp, 1)                
 do irrepi = 1, nirrep 
    irrepabc = dirprd(irrepi, 1)
    irrepabj = dirprd(irrepi, 1)
    numabc = irpdso(irrepi, nabsym, vrta, 1)
    numabj = irpdso(irrepi, nabsym, popa, 1)
    numabj2 = irpdso(irrepi, nabsym2, popa, 1)
    numi = popa(irrepi)
    do i = 1, numi
       ioffi22 = ioffi2(irrepi) + (i-1)*numabc*isd
       iofft22 = iofft2(irrepi) + (i-1)*numabj*isd
       ioffw22 = ioffw2(irrepi) + (i-1)*numabj2*isd

       call getpqrso(icore(i2), i, irrepi, 1, fnameaa)
    !  0.5*iabci*t2abji=r1cj   (iefam*t2efmi=r1ai)
       call VmnpqVmnrs_to_Vpqrs(icore(i2), icore(i0-1+iofft22), irrepi, irrepi, &
                               vrta, vrta, 0, vrta, zorb, 1, popa, zorb, 1, &
                               r1(ifvo(1)), 1, 1.d0, 1.d0)
    !  Pij*IABCI*T1CJ=R2ABJI   (iabej*t1ei=r2abij)
       call VpqmnVmnrs_to_Vpqrs(icore(i2), t1(ifvo(1)), irrepi, 1, &
                               vrta, zorb, 1, vrta, vrta, 0, popa, zorb, 1, &
                               icore(i1-1+iofft22), irrepi, 1.d0, 0.d0)
    !      IABCI*T1BJ=WAICJ    (IEFBM*t1FJ=WEMBJ)
       call iexpso(icore(i2), icore(i5), vrta, vrta, 0, 1, vrta, zorb, 1, 0, irrepi)
       call sstgenso(icore(i5), icore(i2), nsize, vrta, vrta, vrta, zorb, &
                     icore, irrepi, '1324')
    !     tmp(ACJI)
       call VpqmnVmnrs_to_Vpqrs(icore(i2), t1(ifvo(1)), irrepi, 1, &
                               vrta, zorb, 1, vrta, vrta, 1, popa, zorb, 1, &
                               icore(i3-1+ioffw22), irrepi, 1.d0, 0.d0)   
   enddo
 enddo
 !-----R2AAAA
 call sstgenso(icore(i1), icore(i5), nsize, nabsym, popa, zorb, popa, & 
                    icore(i5), 1, '1324')
 call iassymso(icore(i5), icore(i1), 1, vrta, vrta, popa, popa, 0)
 call axpyso(nioi31, 1.d0, icore(i1), 1, r2(ioi3(1)), 1)
 nsize = idsymsoc(1, vrta, vrta, 0, popa, popa, 0) 
 write(6,*)'norm of r2aa', nrm2so(nsize, icore(i1), 1)*2.d0 
 !------WEMBJ
 call sstgenso(icore(i3), icore(i5), nsize, nabsym2, popa, zorb, popa, & 
                    icore, 1, '1324')
 call sstgenso(icore(i5), icore(i3), nsize, vrta, vrta, popa, popa, & 
                    icore, 1, '1423')
 !------FAE
 call sstgenso(icore(i3), icore(i5), nsize, vrta, popa, vrta, popa, &
                    icore, 1, '2431')
 call sumpq(1, popa, vrta, vrta, 1, icore(i5), itmp)
 call axpyso(nifvvaa, 1.d0, itmp, 1, fae(ifvv(1)), 1)
 ! call myicopy(itmp, r1tmp, nifvvaa)
 
 nsize = idsymsoc(1, vrta, vrta, 1, popa, popa, 1)
 call axpyso(nsize, -1.d0, icore(i3), 1, wmbej(ioi4(1)), 1) 
! write(6,*)'norm of wmbejaaaa', nrm2so(nsize, icore(i3), 1)
 !=======================================================================================
 !------IAbCi---------------
 !------calc of R1AA, R2AB, WEmBj and WemBJ
 !=======================================================================================
 nsize = irpdso(1, vrta, popa, 1)
 do irrepab = 1, nirrep 
    nabsym(irrepab) = irpdso(irrepab, vrta, vrtb, 1) 
    nabsym2(irrepab) = irpdso(irrepab, vrta, vrta, 1) 
 enddo
 !
 call sstgenso(t2(ioi3(2)), icore(i0), nsize, nabsym, zorb, popa, popb, &
               icore, 1, '1324')
 !
 iofft2(1) = 1
 ioffi2(1) = 1
 ioffw2(1) = 1   !EBmj
 ioffw3(1) = 1   !BeJm
 do irrepj = 1, nirrep-1
    irrepabi = dirprd(irrepj, 1)
    numj = popb(irrepj) 
    numabi = irpdso(irrepabi, nabsym, popa, 1) 
    numabc = irpdso(irrepabi, nabsym, vrta, 1)
    iofft2(irrepj+1) = iofft2(irrepj) + numj*numabi*isd
    ioffi2(irrepj+1) = ioffi2(irrepj) + numj*numabc*isd
    numabi = irpdso(irrepabi, nabsym2, popb, 1) 
    ioffw2(irrepj+1) = ioffw2(irrepj) + numj*numabi*isd
 enddo
 !
 do irrepi = 1, nirrep
    irrepabc = dirprd(irrepi, 1)
    irrepabj = dirprd(irrepi, 1)
    numabc = irpdso(irrepi, nabsym, vrta, 1)
    numabj = irpdso(irrepi, nabsym, popa, 1)
    numabj2 = irpdso(irrepi, nabsym2, popb, 1)
    numi = popb(irrepi)
    do i = 1, numi
       ioffi22 = ioffi2(irrepi) + (i-1)*numabc*isd
       iofft22 = iofft2(irrepi) + (i-1)*numabj*isd
       call getpqrso(icore(i2), i, irrepi, 1, fnameab)
 !       write(6,*)'norm of iabci', i, nrm2so(numabc, icore, 1)
     ! -0.5*iabci*t2abij=r1cj   
     !  0.5*iabci*t2abji=r1cj  (iefam*t2efim=r1ai)!
       call VmnpqVmnrs_to_Vpqrs(icore(i2), icore(i0-1+iofft22), irrepi, irrepi, &
                               vrta, vrtb, 1, vrta, zorb, 1, popa, zorb, 1, &
                               r1(ifvo(1)), 1, 1.d0, 1.d0) 
    !  Pij*IAbCi*T1CJ=R1AbJi   (IAbEj*t1EI=r2AbIj)
       call VpqmnVmnrs_to_Vpqrs(icore(i2), t1(ifvo(1)), irrepi, 1, &
                               vrta, zorb, 1, vrta, vrtb, 1, popa, zorb, 1, &
                               icore(i1-1+iofft22), irrepi, 1.d0, 0.d0)
    !     IAbCi*T1bj=WAiCj    (IEfBm*t1fj=WEmBj)
       call sstgenso(icore(i2), icore(i5), nsize, vrta, vrtb, vrta, zorb, &
                     icore, irrepi, '1324')
    !     tmp(ACji)
       ioffw22 = ioffw2(irrepi) + (i-1)*numabj2*isd
       call VpqmnVmnrs_to_Vpqrs(icore(i5), t1(ifvo(2)), irrepi, 1, &
                               vrtb, zorb, 1, vrta, vrta, 1, popb, zorb, 1, &
                               icore(i3-1+ioffw22), irrepi, 1.d0, 0.d0)   
    !     IaBCi*T1BJ=WaiCJ    (IeFBm*t1FJ=WemBj)
    !   =-IBaCi*T1BJ
       call sstgenso(icore(i2), icore(i5), nsize, vrta, vrtb, vrta, zorb, &
                    icore, irrepi, '3214')
    !     tmp(CaJi)
       call VpqmnVmnrs_to_Vpqrs(icore(i5), t1(ifvo(1)), irrepi, 1, &
                               vrta, zorb, 1, vrta, vrtb, 1, popa, zorb, 1, &
                               icore(i4-1+iofft22), irrepi, 1.d0, 0.d0)   
    enddo
 enddo
 !----R2ABAB
 nsize = idsymsoc(1, vrta, vrtb, 1, popa, popb, 1)
 call sstgenso(icore(i1), icore(i5), nsize, nabsym, popa, zorb, popb, &
              icore, 1, '1324')
! write(6,*)'norm of test', nrm2so(nsize, icore(i5), 1)
! call myicopyso(icore(i5), ttest, nsize)
 call axpyso(nsize, 1.d0, icore(i5),1, r2(ioi3(2)), 1)
 nsize = irpdso(1, vrta, popa, 1)
 !----WEmBj--
 call sstgenso(icore(i3), icore(i5), nsize, nabsym2, popb, zorb, popb, &
                    icore, 1, '1324')
 call sstgenso(icore(i5), icore(i3), nsize, vrta, vrta, popb, popb, &
                    icore, 1, '1423')
 !------FAE
 call sstgenso(icore(i3), icore(i5), nsize, vrta, popb, vrta, popb, &
                    icore, 1, '2431')
 call sumpq(1, popb, vrta, vrta, 1, icore(i5), itmp)
 call axpyso(nifvvaa, 1.d0, itmp, 1, fae(ifvv(1)), 1)
! call axpyso(nifvvaa, 1.d0, fae(ifvv(1)), 1, r1tmp, 1)
! write(6,*)'norm of Faeaa', nrm2so(nifvvaa, r1tmp, 1)

 nsize = idsymsoc(1, vrta, vrta, 1, popb, popb, 1)
 call axpyso(nsize, -1.d0, icore(i3), 1, wmbej(ioi4(2)), 1)
! write(6,*)'norm of wembjabab', nrm2so(nsize, icore(i3), 1)
 !----WemBJ--
 call sstgenso(icore(i4), icore(i5), nsize, nabsym, popa, zorb, popb, &
                    icore, 1, '1324')
 call sstgenso(icore(i5), icore(i4), nsize, vrta, vrtb, popa, popb, &
                    icore, 1, '2413')
 nsize = idsymsoc(1, vrta, vrtb, 1, popa, popb, 1)
 call axpyso(nsize, 1.d0, icore(i4), 1, wmbej(ioi4(6)), 1)
! write(6,*)'norm of wembjbbaa', nrm2so(nsize, icore(i4), 1)

!==============================================================
!abci  r1bb, r2bbbb, Wmbej
!==============================================================
 call izero(nabsym, 8)
 do irrepab = 1, nirrep
    nabsym(irrepab) = irpdso(irrepab, vrtb, vrtb, 0)
    nabsym2(irrepab) = irpdso(irrepab, vrtb, vrtb, 1)
 enddo
 call iexpso(t2(ioi3(3)), icore(i5), vrtb, vrtb, 0, 0, popb, popb, 0, 1, 1)
 call sstgenso(icore(i5), icore(i0), nsize, nabsym, zorb, popb, popb, &
               icore, 1, '1324')
!
 iofft2(1) = 1
 ioffi2(1) = 1
 ioffw2(1) = 1
 do irrepj = 1, nirrep-1
    irrepabi = dirprd(irrepj, 1)
    numj = popb(irrepj)
    numabi = irpdso(irrepabi, nabsym, popb, 1)
    numabc = irpdso(irrepabi, nabsym, vrtb, 1)
    iofft2(irrepj+1) = iofft2(irrepj) + numj*numabi*isd
    ioffi2(irrepj+1) = ioffi2(irrepj) + numj*numabc*isd
    numabi = irpdso(irrepabi, nabsym2, popb, 1)
    ioffw2(irrepj+1) = ioffw2(irrepj) + numj*numabi*isd
 enddo
 nsize = irpdso(1, vrtb, popb, 1)
 call zeroso(r1tmp, nsize)
 call myicopyso(r1(ifvo(2)), r1tmp, nsize)
 do irrepi = 1, nirrep
    irrepabc = dirprd(irrepi, 1)
    irrepabj = dirprd(irrepi, 1)
    numabc = irpdso(irrepi, nabsym, vrtb, 1)
    numabj = irpdso(irrepi, nabsym, popb, 1)
    numabj2 = irpdso(irrepi, nabsym2, popb, 1)
    numi = popb(irrepi)
    do i = 1, numi
       ioffi22 = ioffi2(irrepi) + (i-1)*numabc*isd
       iofft22 = iofft2(irrepi) + (i-1)*numabj*isd
       ioffw22 = ioffw2(irrepi) + (i-1)*numabj2*isd
       call getpqrso(icore(i2), i, irrepi, 1, fnamebb)
     !  0.5*iabci*t2abji=r1cj  (iefam*t2efim=r1ai)
       call VmnpqVmnrs_to_Vpqrs(icore(i2), icore(i0-1+iofft22), irrepi, irrepi, &
                               vrtb, vrtb, 0, vrtb, zorb, 1, popb, zorb, 1, &
                               r1(ifvo(2)), 1, 1.d0, 1.d0)
    !  Pij*iabci*t1cj=r1abji   (iabej*t1ei=r2abij)
       call VpqmnVmnrs_to_Vpqrs(icore(i2), t1(ifvo(2)), irrepi, 1, &
                               vrtb, zorb, 1, vrtb, vrtb, 0, popb, zorb, 1, &
                               icore(i1-1+iofft22), irrepi, 1.d0, 0.d0)
    !      Iabci*T1bj=Waicj    (Iefbm*t1fj=Wembj)
       call iexpso(icore(i2), icore(i5), vrtb, vrtb, 0, 1, vrtb, zorb, 1, 0,irrepi)
       call sstgenso(icore(i5), icore(i2), nsize, vrtb, vrtb, vrtb, zorb, &
                     icore, irrepi, '1324')
    !     tmp(acji)
       call VpqmnVmnrs_to_Vpqrs(icore(i2), t1(ifvo(2)), irrepi, 1, &
                               vrtb, zorb, 1, vrtb, vrtb, 1, popb, zorb, 1, &
                               icore(i3-1+ioffw22), irrepi, 1.d0, 0.d0)
    enddo
 enddo
 call sstgenso(icore(i1), icore(i5), nsize, nabsym, popb, zorb, popb, & 
                    icore, 1, '1324')
 call iassymso(icore(i5), icore(i1), 1, vrtb, vrtb, popb, popb, 0)
 call axpyso(nioi33, 1.d0, icore(i1), 1, r2(ioi3(3)), 1)
 nsize = idsymsoc(1, vrtb, vrtb, 0, popb, popb, 0) 
 write(6,*)'norm of r2bb', nrm2so(nsize, icore(i1), 1)*2.d0 
 !------Wembj
 call sstgenso(icore(i3), icore(i5), nsize, nabsym2, popb, zorb, popb, & 
                    icore, 1, '1324')
 call sstgenso(icore(i5), icore(i3), nsize, vrtb, vrtb, popb, popb, & 
                    icore, 1, '1423')
 !------FAE
 call sstgenso(icore(i3), icore(i5), nsize, vrtb, popb, vrtb, popb, &
                    icore, 1, '2431')
 call sumpq(1, popb, vrtb, vrtb, 1, icore(i5), itmp)
 call axpyso(nifvvbb, 1.d0, itmp, 1, fae(ifvv(2)), 1)
! call myicopyso(itmp, r1tmp,nifvvbb )
 nsize = idsymsoc(1, vrtb, vrtb, 1, popb, popb, 1)
 call axpyso(nsize, -1.d0, icore(i3), 1, wmbej(ioi4(3)), 1) 
! write(6,*)'norm of wmbejbbbb', nrm2so(nsize, icore(i3), 1)

 !==========================================================================
 !------IaBcI r1bb, r2abab, WeMbJ and WEMbj
 !==========================================================================
nsize = irpdso(1, vrtb, popb, 1)
 do irrepab = 1, nirrep
    nabsym(irrepab) = irpdso(irrepab, vrtb, vrta, 1)
    nabsym2(irrepab) = irpdso(irrepab, vrtb, vrtb, 1)
 enddo
 !
 call isymtrso(t2(ioi3(2)), icore(i5), vrta, vrtb, 1, 1, popa, popb, 1, 0, 1)
 call sstgenso(icore(i5), icore(i0), nsize, nabsym, zorb, popa, popb, &
               icore, 1, '1432')
 !
 iofft2(1) = 1
 ioffi2(1) = 1
 ioffw2(1) = 1
 do irrepj = 1, nirrep-1
    irrepabi = dirprd(irrepj, 1)
    numj = popa(irrepj)
    numabi = irpdso(irrepabi, nabsym, popb, 1)
    numabc = irpdso(irrepabi, nabsym, vrtb, 1)
    iofft2(irrepj+1) = iofft2(irrepj) + numj*numabi*isd
    ioffi2(irrepj+1) = ioffi2(irrepj) + numj*numabc*isd
    numabi = irpdso(irrepabi, nabsym2, popa, 1)
    ioffw2(irrepj+1) = ioffw2(irrepj) + numj*numabi*isd
 enddo
 !
 do irrepi = 1, nirrep
    irrepabc = dirprd(irrepi, 1)
    irrepabj = dirprd(irrepi, 1)
    numabc = irpdso(irrepi, nabsym, vrtb, 1)
    numabj = irpdso(irrepi, nabsym, popb, 1)
    numabj2 = irpdso(irrepi, nabsym2, popa, 1)
    numi = popa(irrepi)
    do i = 1, numi
       ioffi22 = ioffi2(irrepi) + (i-1)*numabc*isd
       iofft22 = iofft2(irrepi) + (i-1)*numabj*isd
       call getpqrso(icore(i2), i, irrepi, 1, fnameba)
     !  0.5*iabci*t2abji=r1cj  (iefam*t2efim=r1ai)
       call VmnpqVmnrs_to_Vpqrs(icore(i2), icore(i0-1+iofft22), irrepi, irrepi, &
                               vrta, vrtb, 1, vrtb, zorb, 1, popb, zorb, 1, &
                               r1(ifvo(2)), 1, 1.d0, 1.d0)
    !  Pij*IAbcJ*T1ci=R1AbJi   (IAbEj*t1EI=r2AbIj)
    !=    -IbAcJ*T1ci=R1bAiJ
       call VpqmnVmnrs_to_Vpqrs(icore(i2), t1(ifvo(2)), irrepi, 1, &
                               vrtb, zorb, 1, vrtb, vrta, 1, popb, zorb, 1, &
                               icore(i1-1+iofft22), irrepi, 1.d0, 0.d0)
    !     IaBcI*T1BJ=WaIcJ    (IeFbM*t1FJ=WeMbJ)
       call sstgenso(icore(i2), icore(i5), nsize, vrtb, vrta, vrtb, zorb, &
                     icore, irrepi, '1324')
    !     tmp(acJI)
       ioffw22 = ioffw2(irrepi) + (i-1)*numabj2*isd
       call VpqmnVmnrs_to_Vpqrs(icore(i5), t1(ifvo(1)), irrepi, 1, &
                               vrta, zorb, 1, vrtb, vrtb, 1, popa, zorb, 1, &
                               icore(i3-1+ioffw22), irrepi, 1.d0, 0.d0)
    !     IAbcI*T1bj=WAIcj    (IEfbM*t1fj=WEMbj)
    !   =-IbAcI*T1bj
       call sstgenso(icore(i2), icore(i5), nsize, vrtb, vrta, vrtb, zorb, &
                    icore, irrepi, '3214')
    !     tmp(cAjI)
       call VpqmnVmnrs_to_Vpqrs(icore(i5), t1(ifvo(2)), irrepi, 1, &
                               vrtb, zorb, 1, vrtb, vrta, 1, popb, zorb, 1, &
                               icore(i4-1+iofft22), irrepi, 1.d0, 0.d0)
    enddo
 enddo
 !----R2ABAB
 call sstgenso(icore(i1), icore(i5), nsize, nabsym, popb, zorb, popa, &
              icore, 1, '1324')
 call isymtrso(icore(i5), icore(i1), vrtb, vrta, 1, 1, popb, popa, 1, 0, 1)
 call isymtrso(icore(i1), icore(i5), vrta, vrtb, 1, 0, popb, popa, 1, 1, 1)
 nsize = idsymsoc(1, vrta, vrtb, 1, popa, popb, 1)
 call axpyso(nsize, 1.d0, icore(i5), 1, r2(ioi3(2)), 1)
 write(6,*)'norm of r2ab', nrm2so(nsize, r2(ioi3(2)), 1)
 !----WeMbJ--
 call sstgenso(icore(i3), icore(i5), nsize, nabsym2, popa, zorb, popa, &
                    icore, 1, '1324')
 call sstgenso(icore(i5), icore(i3), nsize, vrtb, vrtb, popa, popa, &
                    icore, 1, '1423')
 !------Fae
 call sstgenso(icore(i3), icore(i5), nsize, vrtb, popa, vrtb, popa, &
                    icore, 1, '2431')
 call sumpq(1, popa, vrtb, vrtb, 1, icore(i5), itmp)
 call axpyso(nifvvbb, 1.d0, itmp, 1, fae(ifvv(2)), 1)
 ! call axpyso(nifvvbb, 1.d0, fae(ifvv(2)), 1, r1tmp, 1)
! write(6,*)'norm of Faebb', nrm2so(nifvvbb, r1tmp, 1)

 nsize = idsymsoc(1, vrtb, vrtb, 1, popa, popa, 1)
 call axpyso(nsize, -1.d0, icore(i3), 1, wmbej(ioi4(4)), 1)
! write(6,*)'norm of Wembjbaba', nrm2so(nsize, icore(i3), 1)
 !----WEMbj--
 call sstgenso(icore(i4), icore(i5), nsize, nabsym, popb, zorb, popa, &
                    icore, 1, '1324')
 call sstgenso(icore(i5), icore(i4), nsize, vrtb, vrta, popb, popa, &
                    icore, 1, '2413')
 nsize = idsymsoc(1, vrta, vrtb, 1, popa, popb, 1)
 call axpyso(nsize, 1.d0, icore(i4), 1, wmbej(ioi4(5)), 1)
! write(6,*)'norm of wembjaabb', nrm2so(nsize, icore(i4), 1) 
 return
 end
